<?
$id=replatestring($_POST[id],false);
$txtten=replatestring($_POST[txtten],false);
$txtdiachi=replatestring($_POST[txtdiachi],false);
$txtdienthoai=replatestring($_POST[txtdienthoai],false);
$txtfax=replatestring($_POST[txtfax],false);
$txtemail=replatestring($_POST[txtemail],false);
$txtyahoo1=replatestring($_POST[txtyahoo1],false);
$txtyahoo2=replatestring($_POST[txtyahoo2],false);
$txtskype=replatestring($_POST[txtskype],false);
$txtskype2=replatestring($_POST[txtskype2],false);
$txtslogan=replatestring($_POST[txtslogan],false);
$txtbanquyen=replatestring($_POST[txtbanquyen],false);
$txthotline=replatestring($_POST[txthotline],false);
$userfile=replatestring($_POST[userfile],false);
$txtnoidung=$_POST[txtnoidung];
$txttitle=$_POST[txttitle];
$txtkeyword=$_POST[txtkeyword];
$txtdesciption=$_POST[txtdesciption];
$txtmau=$_POST[txtmau];
$txtdontknow=$_POST[txtdontknow];
$dodaitin=replatestring($_POST[txtdodai],false);
$dodaisp=replatestring($_POST[txtdodai3],false);
$txtstatus=replatestring($_POST[txtstatus],false);
$txtthongbao=replatestring($_POST[txtthongbao],false);
//Kiem tra tính hợp lệ của dữ liệu
$data=false;
if(checkstring($txtstatus,"number",2)==true){$data=true;}
if($data==true){
	//Sua cau hinh
	//mysql_query("call sp_tbcauhinh_sua('$txtstatus','$txtdodai','$txtthongbao','$txtdodai2','$txtdodai3')");
		mysql_query("Update tbcauhinh SET cauhinh_site_hoatdong='$txtstatus',cauhinh_site_trang='$dodaitin',  cauhinh_site_thongbao ='$txtthongbao', cauhinh_site_socot =1, cauhinh_site_sosanpham ='$dodaisp' where cauhinh_id=1 ");
		
		mysql_query("Update tbcongty SET  congty_ten='$txtten' , congty_diachi='$txtdiachi',congty_dienthoai='$txtdienthoai', congty_fax='$txtfax',congty_email='$txtemail',congty_yahoo1='$txtyahoo1',congty_yahoo2= '$txtyahoo2', congty_skype= '$txtskype',congty_gioithieu='$txtnoidung',congty_logo='$userfile',congty_slogan='$txtslogan',congty_banquyen='$txtbanquyen',congty_hotline='$txthotline',congty_title='$txttitle',congty_keyword='$txtkeyword', congty_des='$txtdesciption', congty_skype2='$txtskype2' where congty_id='$id'");
		$cauthongbao="Bạn đã sửa thành công";
		$link="index.php?progid=10";
		thongbao($cauthongbao,$link);
}else{
		$cauthongbao="Dữ liệu không hợp lệ";
		$link="index.php?progid=10";
		thongbao($cauthongbao,$link);
}
?>